package java8.xml.sax;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.File;

/**
 * @author 周宇
 * @create 2020-08-28 16:34
 */
public class BookSaxDemo {
    public static void main(String[] args) throws Exception  {
        BookHander handler = new BookHander();
        SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser parser = factory.newSAXParser();
        parser.parse(new File("src/main/resources/xml/book.xml"),handler);
        handler.getList().forEach(System.out::println);
    }
}